package com.zhiwei.msf.common.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

import com.zhiwei.msf.common.service.GatewayService;
import com.zhiwei.msf.common.service.impl.GatewayProxyServiceImpl;

@Configuration
@ComponentScan("com.zhiwei.msf.common")
public class CommonAutoConfiguration {

	@ConditionalOnMissingBean(GatewayService.class)
	@Order(Ordered.LOWEST_PRECEDENCE)
	@Bean
	public GatewayService gatewayService() {
		return new GatewayProxyServiceImpl();
	}

}